/* -*- mode: c++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- */

#ifndef _IOHELPER_H_
#define _IOHELPER_H_

#include <sys/types.h>

#include <dybuf.h>

extern off_t io_get_size(const char* fn);

extern bool io_set_size(int fd, off_t len);

extern bool io_goto(int fd, off_t pos);

extern int io_read_safe(int fd, void *p, int size);

extern int io_write_safe(int fd, const void *p, int size);

extern DyBuf *io_read_file(const char *fn);

#endif /* _IOHELPER_H_ */
